Repository navigation
Conversation
The selectors used mpv's sid/aid directly as an index into the track list. sub-add runs asynchronously, so a subtitle added (and selected) after track-list was read gives an sid past the end of the list, and SelectorCell::updateUI() reads out of bounds and crashes. Record each track's id and look the current sid/aid up instead, falling back to the first entry when it is not listed.
VitaSDK's newlib is built without _WANT_IO_C99_FORMATS, so %zd, %zu, %td
and %jd are skipped without consuming their argument. Every following
argument shifts, and a later %s dereferences an integer. mpv's "Too many
packets in the demuxer packet queues" warning ("%s/%d: %zd packets...")
crashed the app this way after a seek.
Wrap newlib's string and stream formatters at link time and rewrite the
format first: z and t are dropped (size_t and ptrdiff_t are 32-bit like
int) and j becomes ll.
start_open() calls cancel_open() when pthread_create() fails, which frees open_cancel. open_demux_reentrant() then passed the NULL open_cancel to mp_cancel_set_parent() and crashed. This happens on the Vita under memory pressure. Fail the load instead, so the app shows an error and the next attempt can work. Bumps the mpv package to pkgrel=4.
Owner
|
Can it be split into 3 separate pull requests? |
This was referenced Nov 23, 2026
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three crashes found on a PS Vita 1000 from
psp2dmpcore dumps. Each was traced to its exact source line with symbols from a matching build.1. Subtitle/audio selector crash (
fix(player))Opening the player settings could crash in
SelectorCell::updateUI().PlayerSettingpasses mpv'ssid(a track id) to the selector as an index into its track list.sub-addruns asynchronously, so a subtitle that is added (and selected) aftertrack-listwas read gives ansidpast the end of the list.updateUI()then readsdata[selection]out of bounds. The audio selector had the same pattern withaid - 1.Fix: record each track's mpv id and look the current
sid/aidup in that list, falling back to the first entry when it isn't listed. This affects all platforms, but on the Vita the slow network subtitle loading makes the race easy to hit.2.
%zdprintf crash (fix(psv))Seeking crashed in mpv's demuxer thread while formatting
" %s/%d: %zd packets, %zd bytes%s%s\n"(part of the "Too many packets in the demuxer packet queues" warning). VitaSDK's newlib is built without_WANT_IO_C99_FORMATS, soz,tandjaren't supported. The conversion is skipped without consuming its argument, every following argument shifts, and%sdereferenced the packet count (0x613f). Any mpv or FFmpeg message with%z…before a%scan crash the same way.Fix: wrap newlib's string and stream formatters at link time (
-Wl,--wrap=_svfprintf_r,_vfprintf_r,vfprintf) and rewrite the format first.zandtare dropped (size_t/ptrdiff_tare 32-bit likeinton the Vita) andjbecomesll. Verified in the final binary thatvsnprintf,snprintf,sprintfandfprintfgo through the wrapper.3. mpv open thread crash (
fix(psv))Starting playback occasionally crashed in
mp_cancel_set_parent()with a NULL slave. In mpv 0.36,start_open()callscancel_open()whenpthread_create()fails, which freesopen_cancel, butopen_demux_reentrant()then uses it anyway. Under memory pressure on the Vita thread creation can fail; retrying the same file then works.Fix: a small mpv patch (
scripts/vita/mpv/loadfile.patch) that fails the load instead. It bumps the mpv package topkgrel=4.Notes
mpv-0.36.0-4before the Vita CI build passes.-4, for the decoder memory pool). Whichever PR is merged second needs that bumped to-5inVITABUILDandbuild.yaml. I can rebase it.